<link href="../Public/css/slideshow.css" rel="stylesheet" />
<link href="../Public/css/style_forum.css" rel="stylesheet" />
<link type="text/css" rel="stylesheet" href="../Public/css/tiezi.css" />
<link type="text/css" rel="stylesheet" href="../Public/css/style_1_common.css" />
<div class="wind_alldivs1" style=" height:500px; background:#FFF">
  <div class="auto" style="background:#FFF">
     <div class="subnav">
        <ul class="crumbs">
            <li>我的位置：</li>
            <li><a href="{$site_url}">{$site_name} </a> </li>
            <li><a href="{$Categorys[$catid]['url']}">&nbsp; &gt; {$Categorys[$catid]['catname']} </a></li>
             <li><a href="index.php?g=Home&m=Zforum_theme&a=forumlist&id=7&plateid={$plate['id']}">&nbsp; &gt; {$plate['name']} </a></li>
            <li>&nbsp; &gt; {$theme['title']} </li>
            <div class="clear"></div>
        </ul>
     
    </div>
        
<style>
#postmessage_1 img{max-width:100%;}
</style>
      
           
 <div id="ct" class="wp cl">
<div class="pgs mtm mbm cl">
<div class="pg">
{$pages}
</div><span class="pgb y"><a href="index.php?g=Home&m=Zforum_theme&a=forumlist&id=7&plateid={$plate['id']}" class="yuan">返回列表</a></span>
<a id="newspecialtmp"  href="index.php?g=Home&m=Zforum_theme&a=add&id=7&plateid={$plate['id']}" title="发新帖"><img  class="yuan" src="../Public/images/fatie_ioc_03.png" alt="发新帖"></a>
</div>
{if $_SESSION ['authId']}
<div id="modmenu" class="xi2 pbm">
<a href="javascript:confirm_delete('/index.php?g=Admin&m=Zforum_theme&a=delete&id={$theme['id']}')" >删除主题</a><span class="pipe">|</span>
{if $theme['top']==0}
<a href="/index.php?g=Admin&m=Zforum_theme&a=top&id={$theme['id']}&top=1&plateid={$plate['id']}" >置顶</a><span class="pipe">|</span>
{else}
<a href="/index.php?g=Admin&m=Zforum_theme&a=top&id={$theme['id']}&top=0&plateid={$plate['id']}" >取消置顶</a><span class="pipe">|</span>
{/if}
{if $theme['essence']==0}
<a href="/index.php?g=Admin&m=Zforum_theme&a=jinghua&id={$theme['id']}&essence=1" >精华</a><span class="pipe">|</span>
{else}
<a href="/index.php?g=Admin&m=Zforum_theme&a=jinghua&id={$theme['id']}&essence=0" >取消精华</a><span class="pipe">|</span>
{/if}
{if $theme['posid']==0}
<a href="index.php?g=Admin&m=Zforum_theme&a=pos&id={$theme['id']}&posid=1" >首页推荐</a><span class="pipe">|</span>
{else}
<a href="index.php?g=Admin&m=Zforum_theme&a=pos&id={$theme['id']}&posid=0" >取消首页推荐</a><span class="pipe">|</span>
{/if}
{if $theme['pos_hot']==0}
<a href="index.php?g=Admin&m=Zforum_theme&a=pos&id={$theme['id']}&pos_hot=1" >热门推荐</a>
{else}
<a href="index.php?g=Admin&m=Zforum_theme&a=pos&id={$theme['id']}&pos_hot=0" >取消热门推荐</a>
{/if}
<span style="float:"></span>
</div>
{/if}
{if $theme}
<div id="postlist" class="pl bm" style="border: 2px solid #CDCDCD;">

<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td class="pls ptn pbn">
<div class="hm ptn">
<span class="xg1">查看:</span> <span class="xi1">{$theme['hits']}</span><span class="pipe">|</span><span class="xg1">回复:</span> <span class="xi1">{$theme['reply_num']}</span>
</div>
</td>
<td class="plc ptm pbn vwthd">

<h1 class="ts">
<!--标题-->
<span id="thread_subject">
<span id="title_k">{$theme['title']}</span>  {if $theme['essence']==1 } <img  src="../Public/images/jinghua_1.gif" />{/if}&nbsp; &nbsp; 
{if $theme['top']==1 }<img  src="../Public/images/top_1.gif" />{/if}&nbsp; &nbsp;
<if condition="$theme['posid']!=0"><img src="./Public/Images/admin_elite.gif"></if> 
</span>
</h1>

</td>
</tr>
</tbody></table>


<table cellspacing="0" cellpadding="0" class="ad">
<tbody><tr>
<td class="pls">
</td>
<td class="plc">
</td>
</tr>
</tbody></table>
{php $ppp=intval($_GET['p'])}
<volist name="list" id="r" key="k">
{if $k==1}
<div id="post_1">
<table id="pid1" class="plhin" summary="pid1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="pls" rowspan="2">
<div id="favatar1" class="pls favatar">

<div class="pi">
    <div class="authi">
     <a href="index.php?m=User&a=index&id={$r['userid']}" target="_blank" class="xw1">{$theme['username']}</a>
    </div>
</div>

<div>
<div class="avatar" ><a href="index.php?m=User&a=index&id={$theme['userid']}" class="avtm" target="_blank">{if empty($theme['avatar'])}<img src="./Public/Images/order3.png">{else}<img src="{$theme['avatar']}">{/if}</a></div>
</div>
<p>身份：{if $theme['groupid']==1} 设计师{elseif  $theme['groupid']==2 } 业主{elseif  $theme['groupid']==3} 供应商{elseif $r['username']=='管理员'}管理员{/if} </p>
<p>所在地:{$theme['province']|jgarea=###} {$theme['city']|jgarea=###}</p>

<div class="tns xg2">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th><p>{$theme['theme_num']}</p>帖子</th>
<th><p>{$theme['essence_num']}</p>精华</th>
<td><p>{$theme['u_reply_num']}</p>回复</td>
</tr>
</tbody>
</table>
</div>

</div>
</td>
<td class="plc">
<div class="pi">

<strong>
<a id="postnum1" >
楼主</a>
</strong>
<div class="pti">
<div class="pdbt">
</div>
<div class="authi">
<img class="authicn vm" id="authicon1" src="../Public/images/online_member.gif">
<em id="authorposton1">发表于 <span title="2016-5-11 17:14:54">{$theme['createtime']|remianday=###}</span></em>
<span class="pipe">|</span>
{if $_GET['userid']}
<a href="index.php?g=Home&m=Zforum_reply&a=index&id={$theme['id']}&plateid={$plate['id']}" rel="nofollow">查看全部</a>
{else}
<a href="index.php?g=Home&m=Zforum_reply&a=index&id={$theme['id']}&plateid={$plate['id']}&userid={$theme['userid']}" rel="nofollow">只看该作者</a>
{/if}
</div>
</div>
</div><div class="pct"><style type="text/css">.pcb{margin-right:0}</style><div class="pcb">
 
<div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tbody><tr><td class="t_f" id="postmessage_1">
{$theme['content']|pre_tel}</td></tr></tbody></table>


</div>
<div id="comment_1" class="cm">
</div>

<div id="post_rate_div_1"></div>
</div>
</div>

</td></tr>
<tr><td class="plc plm">



        
<div class="sign" style="border-top: 1px dashed #CDCDCD;">&nbsp;&nbsp;&nbsp;&nbsp;
  <a href="javascript:onclick=keep({$theme['id']})" title="点击收藏" > <img src="../Public/images/xingxing.png" />&nbsp;&nbsp;<span style="font-size:18px;">{$theme['keep_num']}</span></a>
    <div class="hm cl" style="float:right; margin-right:80px;">
    <div id="bdshare" class="bdshare_t bds_tools_24 get-codes-bdshare">
    <span class="bds_more" style="text-indent:0;padding-left: 32px;width: auto;font-size: 18px;font-family: '微软雅黑';">分享到</span>
    <a class="bds_qzone" title="分享到QQ空间" href="#"></a>
    <a class="bds_tsina" title="分享到新浪微博" href="#"></a>
    <a class="bds_tqq" title="分享到腾讯微博" href="#"></a>
    <a class="bds_renren" title="分享到人人网" href="#"></a>
    <a class="bds_t163" title="分享到网易微博" href="#"></a>
    </div>
    <script type="text/javascript" id="bdshare_js" data="type=tools" src="http://bdimg.share.baidu.com/static/js/bds_s_v2.js?cdnversion=406586"></script>

    </div>

</div>
</td>
</tr>
<tr id="_postposition1"></tr>
<tr>
<td class="pls"></td>
<td class="plc" style="overflow:visible;">
<div class="po hin">
<div class="pob cl">
<em>
<a class="fastre" href="" onclick="">回复</a>
</em>

<p>
<a href="javascript:;" id="mgc_post_1"  class="showmenu" style="display: none;"></a>

</p>

</div>
</div>
</td>
</tr>
<tr class="ad">
<td class="pls">
</td>
<td class="plc">
</td>
</tr>
</tbody></table>
</div>
{else}

<!--帖子回复-->


<div id="post_1">
<table id="pid1" class="plhin" summary="pid1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="pls" rowspan="2">
<div id="favatar1" class="pls favatar">

<div class="pi">
    <div class="authi">
     <a href="index.php?m=User&a=index&id={$r['userid']}" target="_blank" class="xw1">{$r['username']}</a>
    </div>
</div>

<div>
<div class="avatar" ><a href="index.php?m=User&a=index&id={$r['userid']}" class="avtm" target="_blank">{if empty($r['avatar'])}<img src="./Public/Images/order3.png">{else}<img src="{$r['avatar']}">{/if}</a></div>
</div>
<p>身份：{if $r['groupid']==1} 设计师{elseif  $r['groupid']==2 } 业主{elseif  $r['groupid']==3} 供应商{/if} </p>
<p>所在地：{$r['province']|jgarea=###} {$r['city']|jgarea=###}</p>
<div class="tns xg2">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th><p>{$r['theme_num']}</p>帖子</th>
<th><p>{$r['essence_num']}</p>精华</th>
<td><p>{$r['reply_num']}</p>回复</td>
</tr>
</tbody>
</table>
</div>


</div>
</td>
<td class="plc">
<div class="pi">

<strong>
<a  id="postnum1" >{$r['floor']}楼 &nbsp;&nbsp;{if $theme['userid']==$r['userid']}楼主{/if}</a>
</strong>
<div class="pti">
<div class="pdbt">
</div>
<div class="authi">
<img class="authicn vm" id="authicon1" src="../Public/images/online_member.gif">
<em id="authorposton1">发表于 <span title="2016-5-11 17:14:54">{$r['createtime']|remianday=###}</span></em>
<span class="pipe">|</span>
{if $_GET['userid']}

{else}
<a href="index.php?g=Home&m=Zforum_reply&a=index&id={$r['id']}&plateid={$plate['id']}&userid={$r['userid']}" rel="nofollow">只看该作者</a>
{/if}

</div>
</div>
</div><div class="pct"><style type="text/css">.pcb{margin-right:0}</style><div class="pcb">
 
<div class="t_fsz">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="t_f" id="postmessage_1">
{$r['content']|pre_tel}
</td>
</tr>
</tbody>
</table>


</div>
<div id="comment_1" class="cm">
</div>

<div id="post_rate_div_1"></div>
</div>
</div>

</td></tr>

<tr id="_postposition1"></tr>
<tr>
<td class="pls"></td>
<td class="plc" style="overflow:visible;">
<div class="po hin">
<div class="pob cl">
<em>
<a class="fastre" href="javascript:huifu({$r['id']},'{$r['username']}','{$r['userid']}',1)" >回复</a>
</em>
<p>
{if $_SESSION ['authId']}
<a href="javascript:confirm_delete('/index.php?g=Admin&m=Zforum_reply&a=delete&id={$r['id']}')" >删除</a>
{/if}
</p>
<script type="text/javascript">
 function  huifu(pid,username,userid,rid){
	 
	 var sma=$("#cook_id").val();
	 //alert(sma)
	 if(sma){
		
	 uname=username;
	 if(rid==1){
		  username='';
		 }	
    var html=' ';
		html+='<form action="index.php?g=Home&m=Zforum_reply&a=insert" method="post"  >';
		html+=' <input  type="hidden" name="reply[theme_id]" value="<?php echo $theme[id]?>" />';
		html+=' <input  type="hidden" name="reply[pid]" value='+pid+' />';
		html+=' <input  type="hidden" name="reply[re_name]" value="'+username+'"  />';
	    html+='<textarea id="content1" class="content  yuan" name="reply[content]" style=" margin-left:10px;width:700px;height:200px;font-family: 微软雅黑;"></textarea>';
		html+=' <input  type="hidden" name="mes[theme_title]" value="<?php echo $theme[title]?>"  />';
	    html+=' <input  type="hidden" name="mes[userid]" value="'+userid+'"  />';
		html+=' <input  type="hidden" name="mes[username]" value="'+uname+'"  />';
		html+=' <input  type="hidden" name="mes[theme_id]" value="<?php echo $theme[id]?>"  />';
	    html+=' <input  type="hidden" name="mes[url]" value="<?php echo "index.php?".$_SERVER[QUERY_STRING]?>"  />';
	
	
        html+='<input style=" float:right; width:100px;margin-top:20px;margin-right:20px; height:30px;background:#604328; color:#FFF; border: #FFF solid 0px;" type="submit"   value="发布帖子"/></form>   ';
	 
	 layer.open({
	  type: 1,
	  title :'回复:'+username,
	  skin: 'layui-layer-rim', //加上边框
	  area: ['720px', '340px'], //宽高
	  content: html
	});
	 }else{ 
	   layer.open({
	  type: 1,
	  title :'回复:',
	  skin: 'layui-layer-rim', //加上边框
	  area: ['720px', '340px'], //宽高
	  content: '<div style=" width:100%; background:#FFF;  float:left; height:204px; line-height:200px; margin-top:20px; border:#999 solid 1px;"><div style=" text-align:center; font-size:16px">您需要登录后才可以发帖&nbsp;&nbsp;&nbsp; <span ><a style="color:#06F" href="index.php?g=User&m=Login&a=index">登录</a></span>&nbsp;|&nbsp;<span ><a style="color:#06F" href="index.php?g=User&m=Register&a=index">注册</a></span></div></div>'
	});
	  
	 }
}

</script>
<p>
<a href="javascript:;" id="mgc_post_1"  class="showmenu" style="display: none;"></a>

</p>

</div>
</div>

<!--楼中楼-->
<div class="core_reply_content">
<div id="listDiv{$r['id']}" >
<?php  
        $count = M('Zforum_reply')->where('pid='.$r['id'])->count();
        import ( "@.ORG.Page" );
        $listRows =8;
        $page = new Page ( $count, $listRows );
        $pages1 = $page->ajaxshow($r['id']);
        $field='jg_Zforum_reply.*,jg_user.avatar ';
        $list=M('Zforum_reply')->field($field)->where('pid='.$r['id'])->join('jg_user ON jg_Zforum_reply.userid = jg_user.id')->order('jg_Zforum_reply.id asc')->limit(8)->select();
        foreach($list as $k=>$v){      
           ?>
<ul class="j_lzl_m_w" style=" display:">
    <li class="lzl_single_post" >
        <a  target="_blank" class="lzl_p_p" href="" ><img src="{$v['avatar']}"></a>
        <div class="lzl_cnt"><a class="at j_user_card "  href="" style="color:#06F" >{$v['username']} </a>:{if $v['re_name']} 回复 {$v['re_name']}:{/if}&nbsp;<span class="lzl_content_main">{$v['content']}</span>
        <div class="lzl_content_reply">
            <span class="lzl_jb" style="">&nbsp;
               {if $_SESSION ['authId']}
                <a href="javascript:confirm_delete('/index.php?g=Admin&m=Zforum_reply&a=delete&id={$v['id']}')">删除</a>|&nbsp;
               {/if}
             </span>
            <span class="lzl_time">{$v['createtime']|remianday=###}</span>
            <a href="javascript:huifu({$r['id']},'{$v['username']}','{$v['userid']}')" class="lzl_s_r">回复</a>
        </div>
        </div>
    </li>
</ul>
<?php }?>
</div>
<li style="height:25px;"><a   style="float:right" href="javascript:huifu({$r['id']},'{$r['username']}','{$r['userid']}',1)"><i class="icon-reply"></i>我也说一句</a>
     <p class="fengye pageDIV" id="pageDIV{$r['id']}"  name="{$r['id']}" >
      {$pages1}
     </p>
</li>
</div>
<!--楼中楼end-->

</td>
</tr>
<tr class="ad">
<td class="pls">
</td>
<td class="plc">
</td>
</tr>
</tbody></table>
</div>
{/if}
</volist>
<!--回复-->



<div id="postlistreply" class="pl"><div id="post_new" class="viewthread_table" style="display: none"></div></div>
</div>
{else}
<div style=" width:100%; height:300px; text-align:center; line-height:300px; font-size:18px; ">该帖子已被删除</div>

{/if}


<form method="post" autocomplete="off" name="modactions" id="modactions">
<input type="hidden" name="formhash" value="a90fadd2">
<input type="hidden" name="optgroup">
<input type="hidden" name="operation">
<input type="hidden" name="listextra" value="page%3D1">
<input type="hidden" name="page" value="1">
</form>



<div class="pgs mtm mbm cl">
<div class="pg">
{$pages}
</div><span class="pgb y"><a href="index.php?g=Home&m=Zforum_theme&a=forumlist&id=7&plateid={$plate['id']}" class="yuan">返回列表</a></span>
<a id="newspecialtmp"  href="index.php?g=Home&m=Zforum_theme&a=add&id=7&plateid={$plate['id']}" title="发新帖"><img class="yuan" src="../Public/images/fatie_ioc_03.png" alt="发新帖"></a>
</div>

<!--[diy=diyfastposttop]--><div id="diyfastposttop" class="area"></div><!--[/diy]-->

 {if cookie('auth')}  
<div id="f_pst" class="pl bm bmw">
<form action="index.php?g=Home&m=Zforum_reply&a=insert" method="post"  >
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td class="pls">
</td>
<td class="plc">
<div class="cl">
<textarea id="content1" class="content yuan" name="reply[content]" style="width:700px;height:200px;"></textarea>
</div>


<input type="hidden" name="reply[theme_id]" value="{$theme['id']}">
<input type="hidden" name="mes[theme_id]" value="{$theme['id']}">
<input type="hidden" name="mes[theme_title]" value="{$theme['title']}">
<input type="hidden" name="mes[userid]" value="{$theme['userid']}">
<input type="hidden" name="mes[username]" value="{$theme['username']}">
<input type="hidden" name="mes[url]" value="index.php?{$_SERVER['QUERY_STRING']}"


<p class="ptm pnpost">

<style>

</style>
<input type="submit" value="发表回复" class="dfsj_pn vm" style="margin-top:10px;" />
<!--<label for="fastpostrefresh"><input id="fastpostrefresh" type="checkbox" class="pc">回帖后跳转到最后一页</label>-->

</p>
</td>
</tr>
</tbody></table>
</form>
</div>
{else}

<div id="f_pst" class="pl bm bmw" style="border: 2px solid #CDCDCD;">
<form action="index.php?g=Home&m=Zforum_reply&a=insert" method="post"  >
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td class="pls">
</td>
<td class="plc"  align="center">
<div style=" text-align:center; font-size:16px">
       您需要登录后才可以回帖&nbsp;&nbsp;&nbsp;
       <span ><a style="color:#06F" href="{:URL('User-Login/index')}">登录</a></span>&nbsp;|&nbsp;
       <span ><a style="color:#06F" href="{:URL('User-Register/index')}"/>注册</a></span> 
       </div>
<p class="ptm pnpost"></p>
</td>
</tr>
</tbody></table>
</form>
</div>



{/if}

</div>
     
</div> 
      
      
      <div style="clear:both;"></div>
      <div style="width:100%;height:40px;"></div>
          <!-- end -->
  </div>

<link rel="stylesheet" href="./Public/Js/Kindeditor/themes/default/default.css" />
<script charset="utf-8" src="./Public/Js/Kindeditor/lang/zh_CN.js"></script>

<script type="text/javascript" src="/Public/Js/jquery.artDialog.js?skin=default"></script> 
<script type="text/javascript" src="/Public/Js/iframeTools.js"></script>


<script>
			var editor;
			KindEditor.ready(function(K) {
				editor = K.create('textarea[class="content"]', {
					allowFileManager : true,
					uploadJson : "index.php?g=User&m=Upload&a=index",//图片上传后的处理地址
					width : '587px',
					height: '136px',
					items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'emoticons', 'image']
				});
				
			});
			
	function confirm_delete(url){
	art.dialog.confirm("确认要删除信息吗?", function(){location.href = url;});
}
		
	
			
</script>
<script type="text/javascript">
//分页

$(document).ready(function(e){
	
		   $(".pageDIV a").live("click",function(){
			   var url=$(this).attr("href");
			   var id=$(this).parent().attr("name");
			
			// alert(url)
        $.ajax({
        type:"GET",
        url: url,
        //data: "name=John&location=Boston",
		dataType:'json', //数据类型
        success: function(msg){
			var result_len=msg.result.length;
			
			
			var html='';
			var date='';
			var u='';
			
			for(var i=0;i<result_len;i++){
			    date=getLocalTime(msg.result[i].createtime);
				if(msg.sssawc){
				 u='<a href="';	
			     u+="javascript:confirm_delete('/index.php?g=Admin&m=Zforum_reply&a=delete&id="+msg.result[i].id+"')";
				 u+='">删除</a>|';
				}else{
					u=' ';
					}
				html+='<ul class="j_lzl_m_w" style=" display:">';
                html+='<li class="lzl_single_post" >';
			    html+='<a target="_blank" class="lzl_p_p" href="" ><img src="'+msg.result[i].avatar+'"></a>';
                html+='<div class="lzl_cnt"><a class="at j_user_card "  href="" style="color:#06F" >'+msg.result[i].username+'</a>:&nbsp;';
				html+='<span class="lzl_content_main">'+msg.result[i].content+'</span>';
                html+='<div class="lzl_content_reply"><span class="lzl_jb" style="">&nbsp;'+u+'</span>';
				html+='<span class="lzl_time">'+date+'</span>';
				html+='<a href="javascript:huifu('+id+',\''+msg.result[i].username+'\',\''+msg.result[i].userid+'\')" class="lzl_s_r">回复</a></div>';
                html+='</div></li></ul>';
				
				}
			
			 $("#pageDIV"+id).html(msg.pages);//替换分页函数
			 
			 $("#listDiv"+id).html(html);//替换HTML代码
			
			
	 }
   
    		
});
			   
			   
			   
			    return false;//阻止刷新
     
			   })
		   
		   });
	  
	   
	function getLocalTime(nS) {   
	   var　d=new Date(parseInt(nS) * 1000).toLocaleString();
       return d.replace('/', "-").replace('/', "-").replace('上午', "").replace('下午', "");  
    }     
   
	   
	   
	   

</script>
<script type="text/javascript">
function  keep(id){
	
	
		  var module='Zforum_theme';
		  
		  var url=window.location.search;
		  url='index.php'+url;
		  var title=$("#title_k").html();
		 
      //alert(title);
		  //var userid=$("#keep_u").attr('name');
		 // alert(userid)
	
		  $.post(
				  'index.php?g=User&m=Index&a=keep', 
				  {'id':id,
				   'module':module,
				   'url':url,
				   'title':title,
				   
				  },
				  function(res){
					 if(res.length>1000){
						alert('您还未登录，请您先登录');
						 } else{
							 alert(res);
							 if(res=='收藏成功!'){
							  var keepnum=parseInt($(".keep_n").html())+1;
							  $(".keep_n").html(keepnum);
							  }
						 }
					 
					});
	  
	}





</script>